<template>
    <div>
        <el-select v-bind="$attrs" @change="onChange" filterable placeholder="请选择" style="width: 240px">
            <el-option v-for="item in dataList" :key="item.column_id" :label="item.label" :value="item.column_id" />
        </el-select>
    </div>

</template>

<script setup lang="ts">
import { reactive, defineEmits, useAttrs } from "vue";
import $data from "xcore/data"
const emit = defineEmits(['change'])
const dataList: any[] = reactive([])
const attrs = useAttrs();



$data.provider.meta.getMetaTable(attrs.tableId).then((res: any) => {
    dataList.length = 0;
    dataList.push(...res);
})
const onChange = (val: any) => {
    emit('change', val)
}

</script>

<style scoped></style>